﻿@using Whoever.Framework.Enum;

@using Comswing.Business;

@model Comswing.Website.Models.AccountViewModels.LoginViewModel

<div data-bind="with: viewModel.Login">
    @using (Html.BeginForm("Login", "Account", FormMethod.Post, new { id = "login", @data_bind = "submit: viewModel.AttempLogin" }))
    {
        <div class="form-group">
            @Html.LocalizedLabelFor(Model => Model.Account)
            @Html.KOLocalizedHelpFor(Model => Model.Account, MessageType.Warning, "FailedSubmit")
            @Html.TextBoxFor(Model => Model.Account, new { @data_bind = "value: Account, css: { inputerror: Account.hasError }", @class = "form-control", @placeholder = @Html.LocalizedText("AccountPlaceHolder") })
        </div>
        <div class="form-group">
            @Html.LocalizedLabelFor(Model => Model.Password)
            @Html.KOLocalizedHelpFor(Model => Model.Password, MessageType.Warning, "FailedSubmit")
            @Html.TextBoxFor(Model => Model.Password, new { @data_bind = "value: Password, css: { inputerror: Password.hasError }", @class = "form-control", @type = "password", @placeholder = @Html.LocalizedText("PasswordPlaceHolder") })
        </div>
        <button data-bind="click: viewModel.AttempLogin" type="button" class="btn btn-action">@Html.LocalizedAction("Login")</button> 
    }
</div>
